home *** CD-ROM | disk | FTP | other *** search
/ Ham Radio 2000 / Ham Radio 2000.iso / ham2000 / tcp_ip / rose_nos / rosetech < prev   
Text File  |  1992-02-26  |  4KB  |  75 lines

  1. Footnotes (The rest of this is not necessary to support rosenet.doc):
  2.  
  3. NET's Internals
  4.  
  5. Incoming frames from a kiss tnc are handled by kiss_recv(interface,bp) 
  6. in kiss.c.  It calls dump() and then calls ax_recv(interface,bp).
  7.  
  8. ax_recv() is in ax25.c.  It checks for our call in the digipeater fields 
  9. and then checks destination field.  If it is for us and if it is UI it 
  10. checks PID and if IP or ARP sends to ip_route() or arp_input().  If it 
  11. is lapb (connected mode) it creates struct ax25_cb *axp if necessary 
  12. (cr_ax25(&hdr.source) in ax25subr.c), swaps source and destination 
  13. calls, reverses digipeater string and calls lapb_input().  cr_ax25() 
  14. sets maxframe and some other things as well as connecting r_upcall to 
  15. ax_incom() in ax25.c.  This function is what handles "no L3 protocol" 
  16. information frames and normally calls either a mailbox session, or if 
  17. mbox is not active, a telnet session over ax25.
  18.  
  19. (In NOS, struct ax25 *addr is not included in the cb so you have to do a 
  20. route lookup to get the digipeater list.)
  21.  
  22. (The following are notes made while inserting the ROSE hook and later 
  23. while looking for funny response from ROSE.  I am looking to see if we 
  24. are responsible for the ROSE switches refusing to re-establish a connec-
  25. tion with the, "*** call cleared, remote station connecting to you", 
  26. message if the target IP station's state is disconnected, and the ROSE 
  27. switch still thinks it has a link.  I think we comply with the AX.25 
  28. rules here.  They state that the disconnected station should send a DM 
  29. in this case.  Anyway, here are my notes.)
  30.  
  31. Lapb_input(axp,cmdrsp,bp) handles incoming frames as follows:
  32.  
  33. 1. If incoming frame is SABM and we are disconnected, it sends response 
  34. and calls lapbstate(axp,CONNECTED).  lapbstate() calls s_upcall().  
  35. Normally this is ax_state(axp,old,new) in ax25cmd.c.  This normally only 
  36. prints new state to screen if we have a session going.
  37.  
  38. 2. If incoming frame is UA and we are in CONNECTED state, lapb_input 
  39. handles this as an exception by calling est_link(axp) which sends anoth-
  40. er SABM.  (We should have been in setup).  In setup, a UA causes us to 
  41. call lapbstate(axp,CONNECTED).
  42.  
  43. 3. If incoming frame is I and we are in DISCONNECTED state we send a DM.
  44.    (This is the state of things when we get the funny message.)
  45.  
  46. 4. If incoming frame is I, and we are in CONNECTED state, lapb_input() 
  47. calls procdata(axp,bp).  procdata(), in lapb.c, extracts PID.  If 
  48. rose_enable is TRUE, it calls check_rose(axp) which returns TRUE if it 
  49. is a rose circuit and the PID is replaced by the PID_IP.  (No need for 
  50. ARP here.)  Then if PID is IP, lapb_input() calls ip_route(bp,0).  If we 
  51. had not replaced the pid, it would have been PID_NO_L3, which would have 
  52. resulted in a call to r_upcall() which is normally ax_incom().
  53.  
  54. 5. An initial incoming I frame with "no L3 PID" pass by ax_incom().  If 
  55. it goes to the mailbox subsequent I frames no longer see ax_incom() but 
  56. go to mbx_incom() instead (if mbox is enabled).
  57.  
  58. (In NOS, procdata() calls handleit() where I put check_rose().)
  59.  
  60. In the interest of speed, check_rose() first checks for a valid number 
  61. of "digi" calls in an information frame header.  (ROSE can handle one 
  62. digi on either end of an AX.25 circuit plus it's address (the "telephone 
  63. number" call sign), so the minimum number of "digi" calls is two, the 
  64. maximum is four.  Check_rose() then looks for the IP station's AX.25 
  65. call in it's table.  If it finds it, it then checks the neighbor ROSE's 
  66. call in either the last "digi" heard, or the next to last.  If all 
  67. conditions are met, check_rose() returns TRUE, else returns FALSE.
  68.  
  69. Frames observed going from the ROSE switch to the IP station have the 
  70. PID_NO_L3 set (0xf0) and the first information characters are "E", 
  71. (0x45), followed by a nul.  What my smart monitoring program sees is a 
  72. string of information frames containing the single letter "E".
  73.  
  74. Joe, K5JB
  75.